﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Animal
    {
        protected int leg;

        public int Leg
        {
            get { return this.leg; }
            set { this.leg = value; }
        }
        public void Walk()
        {
            Console.WriteLine("走路!");
        }
        public void Eat()
        {
            Console.WriteLine("吃饭！");
        }
       
        public void Run()
        {
            Console.WriteLine("跑！");
        }
        //虚方法
        public virtual void Cry()
        {
            Console.WriteLine("预备备，叫！");
        }

    }
}
